#include <iostream>
#include <string>
#include <vector>

int main()
{
    int N, E;
    std::cin >> N;
    std::cin >> E;

    std::vector<int> X;
    std::vector<int> Y;
    int curx = 0;
    int cury = 0;
    X.push_back(curx);
    Y.push_back(cury);

    for (int i = 0; i < N; i++)
    {
        int x, y;
        std::cin >> x >> y;
        curx = x;
        cury += y;
        X.push_back(curx);
        Y.push_back(cury);
    }

    float area = 0;
    for (int i = 1; i < N + 1; i++)
    {
        std::cout << Y[i - 1] << " " << X[i] << " " << X[i - 1] << std::endl;
        area += abs((Y[i - 1])) * (X[i] - X[i - 1]);
    }
    std::cout << Y[N] << " " << X[N] << " " << E << std::endl;
    area += abs((Y[N])) * (E - X[N]);

    std::cout << (int)area << std::endl;
    return 0;
}